﻿<%@ Page Title="" Language="C#" MasterPageFile="~/SubPage.Master" AutoEventWireup="true" CodeBehind="MessageList.aspx.cs" Inherits="School.WebPages.Message.MessageList" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .subject{ font-family:黑体; font-size:20px; margin:20px auto 10px auto;  text-align:center; color:#265691;}        
        .msg_container{ width:760px; border-top:solid 1px #FC7B00; margin:0 auto; padding-top:10px; font-size:14px;}
        .q_container{border:solid 1px #A9CBEE; margin-bottom:5px;}
        .q_title{ height:25px; background-color:#F6F9FE; border-bottom: solid 1px #A9CBEE; line-height:25px;
                   padding-left:20px; font-size:12px; font-weight:bold; background-image:url(../../images/pic_01.gif); 
                    background-position:2px 5px; background-repeat:no-repeat;}
        .q_content{ padding:5px; line-height:20px;}
        .a_container{ background-color:#FFFFCC; color:#008000; border-top:solid 1px #A9CBEE; padding:5px;}
        .a_tip{ font-weight:bold;}
        .pager_container{ border:solid 1px #A9CBEE;background-color:#F6F9FE; font-size:13px; height:25px; margin:auto; line-height:25px;}
        #ctl00_ContentPlaceHolder1_AspNetPager1{ margin-right:10px; float:right;}
        .td1{ text-align:right;}
        .red{ color:Red;}
        .q_table{ font-size:13px;}
        .q_table input[type=text],textarea{ border:solid 1px #265691;}
        input[type=reset]{ background-color:Transparent; background-image:url(../../images/msg_reset.png); width:90px; height:25px; border:none;}
        .inputNumber{ margin-top:5px; color:#666666; margin-right:30px;}
        .q_title_time{ margin-right:10px;}
        .btn_list{ margin:auto; width:185px;}
        .btn_list li{ float:left; list-style:none;}
    </style>
    <script type="text/javascript">
        $(document).ready(function() {
            $("#ctl00_ContentPlaceHolder1_txbMessage").keyup(function() {
                if ($(this).val().length > 2000) {
                    $(this).val($(this).val().substr(0, 2000));
                    $(".inputNumber span").text("0");
                }
                else {
                    var number = 2000 - $(this).val().length;
                    $(".inputNumber span").text(number);
                }
            });
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="subject">留言板</div>
    <div class="msg_container">
        <asp:Repeater ID="rep_message" runat="server" 
            onitemdatabound="rep_message_ItemDataBound">
            <ItemTemplate>
                <div class="q_container">
                    <div class="q_title"> 
                        <div class="float_left">[<%#Eval("ClientName") %>]</div>
                        <div class="float_right q_title_time"><%#Eval("QTime") %></div>
                        <div class="clear"></div>
                    </div>
                    <div class="q_content"><%#Eval("Question") %></div>
                    <div class="a_container" id="answerContainer" runat="server">
                        <span class="a_tip">老师回复：</span>
                        <%#Eval("Answer") %>
                    </div>   
                </div>
            </ItemTemplate>
        </asp:Repeater>
        <div class="pager_container" id="a" runat="server">
            <webdiyer:AspNetPager runat="server" ID="AspNetPager1" PageSize="10"                
                CustomInfoHTML="每页%PageSize%条，%CurrentPageIndex%/%PageCount%页" 
                FirstPageText="首页" LastPageText="尾页" NextPageText="下一页" PrevPageText="上一页" 
                ShowCustomInfoSection="Left" SubmitButtonText="Go" TextAfterPageIndexBox="页"  
                CustomInfoClass="customInfo" CustomInfoSectionWidth="120"
                TextBeforePageIndexBox="转到" onpagechanged="AspNetPager1_PageChanged">
            </webdiyer:AspNetPager>
            <div class="clear"></div>
        </div> 
        <div>
            <table class="q_table">
                <tr>
                    <td class="td1"><span class="red">*</span>客户名：</td>
                    <td>
                        <asp:TextBox ID="txbClientName" runat="server"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="必填" ControlToValidate="txbClientName"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td class="td1" valign="top"><span class="red">*</span>留言内容（2000字以内）：</td>
                    <td>
                        <asp:TextBox ID="txbMessage" runat="server" TextMode="MultiLine" Width="500" Height="150"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="必填" ControlToValidate="txbMessage"></asp:RequiredFieldValidator>
                        <div class="float_right inputNumber">您还可输入 <span>2000</span> 个字符</div>
                        <div class="clear"></div>
                    </td>
                </tr>
                <tr>
                    <td class="td1"><span class="red">*</span>验证码：</td>
                    <td>
                        <table cellspacing="0">
                            <tr>
                                <td><asp:TextBox ID="txbCode" runat="server"></asp:TextBox></td>
                                <td><asp:Image ID="safecode" runat="server" ImageUrl="~/ValidateCode/ValidateCode.aspx" AlternateText="验证码" onclick="this.src=this.src+'?'" ToolTip="看不清？点击更换" Width="60" /></td>
                            </tr>
                        </table>                      
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="center">
                        <ul class="btn_list">
                            <li><asp:ImageButton ID="ibtnSubmit" runat="server" 
                            ImageUrl="~/Images/msg_submit.png" onclick="ibtnSubmit_Click" /></li>
                            <li><input id="Reset1" type="reset" value="" /></li>
                        </ul> 
                    </td>
                </tr>
                <tr><td align="center" class="red" colspan="2">
                    <asp:Label ID="lblMsg" runat="server" Text=""></asp:Label></td></tr>
            </table>
        </div>          
    </div>
</asp:Content>
